const config = {
  //服务器端口
  server: {
    port: process.env.APP_PORT
  },
  //日志相关配置
  log: {
    appenders: {
      cheese: { type: 'file', filename: 'logs/cheese.log' },
      // 请求日志
      reqLogger: {
        type: 'dateFile', // 日志类型
        filename: 'logs/reqLogger.log', // 输出文件名
        pattern: '-yyyy-MM-dd-hh.log', // 后缀
        alwaysIncludePattern: true, // 上面两个参数是否合并
        encoding: 'utf-8', // 编码格式
        maxLogSize: '10M' // 最大存储内容
      },
      // 响应日志
      resLogger: {
        type: 'dateFile',
        filename: 'logs/resLogger.log',
        pattern: '-yyyy-MM-dd-hh.log',
        alwaysIncludePattern: true,
        encoding: 'utf-8',
        maxLogSize: '10M'
      },
      // 错误日志
      errLogger: {
        type: 'dateFile',
        filename: 'logs/errorLogger.log',
        pattern: '-yyyy-MM-dd-hh.log',
        alwaysIncludePattern: true,
        encoding: 'utf-8',
        maxLogSize: '10M' // 最大存储内容
      },
      access: { type: 'file', filename: 'logs/access.log' },
      db: { type: 'file', filename: 'logs/db.log' },
      dc: { type: 'file', filename: 'logs/dc.log' }
      //consoleout: { type: 'console' }
    },
    categories: {
      default: { appenders: ['cheese'], level: 'info' },
      reqLogger: {
        appenders: ['reqLogger'],
        level: 'info'
      },
      resLogger: {
        appenders: ['resLogger'],
        level: 'info'
      },
      errLogger: {
        appenders: ['errLogger'],
        level: 'error'
      },
      //访问日志
      access: { appenders: ['access'], level: 'info' },
      db: { appenders: ['db'], level: 'info' },
      dc: { appenders: ['dc'], level: 'info' }
      //   anything: { appenders: ['consoleout'], level: 'debug' }
    }
  },
  //MYSQL数据库相关配置
  db: {
    db_host: process.env.MYSQL_HOST,
    db_port: process.env.MYSQL_PORT,
    db_user: process.env.MYSQL_USER,
    db_pwd: process.env.MYSQL_PWD,
    db_name: process.env.MYSQL_DB
  },
  //redis相关配置
  redis: {
    host: process.env.REDIS_HOST,
    port: process.env.REDIS_PORT,
    password: process.env.REDIS_PWD,
    db: process.env.REDIS_DB
  },
  //阿里OSS相关配置
  oss: {
    region: process.env.REGION,
    accessKeyId: process.env.ACCESSKEYID,
    accessKeySecret: process.env.ACCESSKEYSECRET,
    bucket: process.env.BUCKET
  },
  //阿里云短信相关配置
  sms: {
    accessKeyId: process.env.ACCESSKEYID,
    accessKeySecret: process.env.ACCESSKEYSECRET,
    signName: process.env.SIGNNAME,
    templateCode: process.env.TEMPLATECODE
  },

  jwt: {
    jwt_secret: process.env.JWT_SECRET,
    jwt_expire: process.env.JWT_EXPIRE
  }
}

export default config
